class PasswordRecovery < ActiveRecord::Base
  belongs_to :user
  
  def recovery_url
    "http://babaru.net/password/recover/#{read_attribute('token')}"
  end
  
  protected
  
  before_create :create_token
  
  def create_token
    write_attribute('token', UUID.new)
  end
  
end
